<template>
	<view class="login">
		<!-- #ifdef MP-WEIXIN -->
		<button>微信小程序一键登录</button>
		<!-- #endif -->

		<!-- #ifdef  H5 -->
		<form @submit="formSubmit" class="account">
			<view class="form-item">
				<view class="title">
					账号:
				</view>
				<view class="input">
					<input name="username" type="text" :value="userInfo.username">
				</view>
			</view>

			<view class="form-item">
				<view class="title">
					密码:
				</view>
				<view class="input">
					<input name="password" type="password" :value="userInfo.password">
				</view>
			</view>

			<view class="form-item flex">
				<view class="forget">忘记密码</view>
				<view class="column-line">|</view>
				<view class="reg">注册</view>
			</view>
			<view class="form-item">
				<button form-type="submit">登录</button>
			</view>

		</form>

		<!-- #endif -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {
					username: 13412345678,
					password:123456
				}
			}
		},
		methods: {
			formSubmit(e) {
				console.log(e.detail);
			}
		}
	}
</script>

<style>
	.login {
		width: 100%;
		height: 100vh;
		background: #F2F2F2;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
	}

	.account {
		margin-top: 200rpx;
		width: 500rpx;
		padding: 20rpx;
		height: 600rpx;
	}

	.account .title {
		font-size: 32rpx;
		font-weight: bold;
		color: #222;
	}

	.account .input {
		margin: 20rpx 0;
	}

	.account input {
		border: 1px solid #ccc;
		height: 60rpx !important;
		padding-left: 20rpx;
	}

	.flex {
		display: flex;
		justify-content: space-between;
		font-size: 26rpx;
		color: #ccc;
		margin: 40rpx 0;
	}
</style>
